/**
 * 
 */
package com.primestone.cim.util.enums;

/**
 * @author cesar.mateus
 *
 */
public enum SQLQueryEnum {
	/**
	 * 
	 */
	SELECT_1_BY_IDUSER_PWD("select 1 from users as u where u.cim = 1 and u.iduser = ? and u.passwordx = ?", 2),
	
	/**
	 * 
	 */
	SELECT_1_BY_NOINS("select 1 from topology as t where t.noins = ?", 1),
	
	/**
	 * 
	 */
	SELECT_1_BY_IDSOCKET("select 1 from from sockets as s where s.idsocket = ?", 1),
	
	/**
	 * 
	 */
	INSERT_LASTEXPORTCIM("insert into last_export_cim (NOINS, IDSOCKET, EXPORT_START_DATETIME, EXPORT_END_DATETIME, LAST_LOADPROFILE_DATETIME, LAST_REGISTER_DATETIME, LAST_EVENT_DATETIME, TICKET, BLOCK_ID) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)", 9),
	
	/**
	 * 
	 */
	CALL_SPGETREADINGS("{ ? = call spGetReadings(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) }", 16),
	
	/**
	 * 
	 */
	SELECT_LASTMMDATETIME_LASTREAD_BY_NOINS("select lr.datetime from lastread as lr where lr.noins = ?", 1),
	
	/**
	 * 
	 */
	SELECT_LASTREGDATETIME_LASTREAD_BY_NOINS("select lr.last_register_datetime from lastread as lr where lr.noins = ?", 1),
	
	/**
	 * 
	 */
	SELECT_LASTEVEDATETIME_LASTREAD_BY_NOINS("select lr.last_event_datetime from lastread as lr where lr.noins = ?", 1),
	
	/**
	 * 
	 */
	SELECT_MAX_MMDATETIME_LASTEXPORTCIM_BY_NOINS("select max(le.last_loadprofile_datetime) from last_export_cim as le where le.noins = ?", 1),
	
	/**
	 * 
	 */
	SELECT_MAX_REGDATETIME_LASTEXPORTCIM_BY_NOINS("select max(le.last_register_datetime) from last_export_cim as le where le.noins = ?", 1),
	
	/**
	 * 
	 */
	SELECT_MAX_EVEDATETIME_LASTEXPORTCIM_BY_NOINS("select max(le.last_event_datetime) from last_export_cim as le where le.noins = ?", 1),
	
	/**
	 * 
	 */
	SELECT_ALL_CIMFIELDVALUES("select cfv.cim_field, cfv.cim_value, cfv.cim_enumeration, cfv.cim_description, cfv.seqnum_condition from cim_field_values as cfv", 0),
	
	/**
	 * 
	 */
	SELECT_ALL_IDDEVICES("select t.noins from topology as t where t.idconn <> 'Concentrator' AND t.idconn <> 'Virtual' order by t.noins", 0),
	
	;
	
	private String query;
	private int numParams;
	
	SQLQueryEnum(String query, int numParams) {
		this.query = query;
		this.numParams = numParams;
	}

	/**
	 * @return the query
	 */
	public String getQuery() {
		return this.query;
	}

	/**
	 * @return the numParams
	 */
	public int getNumParams() {
		return this.numParams;
	}
}
